function addToBookMark(url,title){
    var ua = navigator.userAgent.toLowerCase();
    if(ua.indexOf("msie 8")>-1){
        external.AddToFavoritesBar(url,title,title);//IE8
    }else{
        try {
            window.external.addFavorite(url, title);
        } catch(e) {
            try {
                window.sidebar.addPanel(title, url, title);//firefox
            } catch(e) {
                alert("加入收藏失败，请使用Ctrl+D进行添加");
            }
        }
    }
    return false;


}
$(function(){
    $("#fav").click(function(){
        addToBookMark(document.title, window.location.href);
    })
})
